package cn.wolfcode.luowowo.article.domain;

import cn.wolfcode.luowowo.common.domain.BaseDomain;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
public class DestinationCommendTheme extends BaseDomain {
    public static final int ALL_YEAR_SUIT = 0;//全年适宜
    public static final int SEASON = 1;//季节
    public static final int TRIP_MODE = 2;//出行方式
    public static final int HOLIDAY = 3;//节假日

    private String name;//主题名称

    private int type = ALL_YEAR_SUIT;//主题类型

    private String coverUrl;//主题封面

    private Integer sequence;//主题顺序

    public String getJsonString(){
        Map<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("type", type);
        map.put("coverUrl", coverUrl);
        map.put("sequence", sequence);
        return JSON.toJSONString(map);
    }
    public String getTypeName() {
        if (type == 0) {
            return "全年适宜";
        } else if (type == 1) {
            return "季节";
        } else if (type == 2) {
            return "出行方式";
        } else {
            return "节假日";
        }
    }
}